//
//  FXTTaskViewController.m
//  OfferJob
//
//  Created by 郑州动力无限科技 on 2017/6/30.
//  Copyright © 2017年 郑州动力无限科技. All rights reserved.
//

#import "FXTTaskViewController.h"
#import "taskTableViewCell.h"
#import "CellView.h"
#import "CustomTextField.h"
#import "AlerttypeView.h"
#import "AddressView.h"
#import "LewPopupViewAnimationSpring.h"
#import "AlerttypeView.h"
#import "LewPopupViewAnimationSlide.h"
#import "CWActionSheet.h"

#define K_Width  [UIScreen mainScreen].bounds.size.width
#define K_Height [UIScreen mainScreen].bounds.size.height
@interface FXTTaskViewController ()<showTypeDelegate>
@property (nonatomic,strong)NSArray* titleArray;
@property (nonatomic,strong)NSArray* subtitleArray;

@property(nonatomic,strong)UIControl *bgCon;
@property(nonatomic,strong)UIView *bgVi;
@property(nonatomic,strong)UIDatePicker *datePicker;
@property(nonatomic,strong)NSString *startTime,*endTime,*startTimeT,*endTimeT,*jieTime;
@property(nonatomic,strong)NSString*province,*ccity,*area;
@property(nonatomic,assign)NSInteger typee;
@property(nonatomic,strong)UIScrollView *mainSC;
@property(nonatomic,strong)UIView *topView;
//@property(nonatomic,strong)   CustomTextField*  textRight;
@property (strong, nonatomic)  NSString *city;
@property (nonatomic, strong) AddressView *addressView;
@property (nonatomic, strong) UIToolbar *toolBar;
@property(nonatomic,strong)NSString*teyeli;
@property (nonatomic,strong)UITextView* textView;
@property (nonatomic,assign) int sex;
@property (nonatomic,assign) int jiesuantype;
@property (nonatomic,assign) int jiesuan_unit;


@end

@implementation FXTTaskViewController
- (void)showTyp:(NSString*)typ{
    [self.view endEditing:YES];
    self.teyeli=typ;
    NSLog(@"eeee%@",typ);

  UITextField *passwordTextField = (UITextField *)[self.view viewWithTag:11];
  passwordTextField.text=typ;
    [_mainSC refreshControl];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    _startTime = [self getToday];
    _endTime = [self getToday];
    _startTimeT = [self getToday];
    _endTimeT = [self getToday];

    _mainSC=[[UIScrollView alloc]initWithFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT-64-49)];
    _mainSC.userInteractionEnabled=YES;
    _mainSC.backgroundColor=[UIColor whiteColor];
    [self.view addSubview:_mainSC];
    

    _titleArray=[NSArray arrayWithObjects:@"任务标题",@"任务类型",@"性别要求",@"招聘人数",@"任务日期",@"任务时段",@"报名截止",@"结算方式",@"任务酬金",@"所在区域",@"详细地址",@"联系电话",@"任务详情",@"",nil];
    
    _subtitleArray=[NSArray arrayWithObjects:@"请输入不超过12字的兼职名称",@"请选择岗位类型",@"请选择性别",@"请输入招聘人数",@" ",@" ",@" ",@"请选择结算方式",@"请输入任务酬金",@"请选择您的所在区域",@"请输入详细地址",@"请输入联系电话",@" ",@"",nil];
    

    [self  NewtopView];
    
}
- (UIToolbar *)toolBar{
//    if (_toolBar == nil) {
        self.toolBar = [[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44)];
        _toolBar.barTintColor=[UIColor blueColor];
        UIBarButtonItem *item1=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
        UIBarButtonItem *item2=[[UIBarButtonItem alloc]initWithTitle:@"完成" style:UIBarButtonItemStylePlain target:self action:@selector(click)];
        _toolBar.items = @[item1, item2];
//    }
    
    if ([_delegete respondsToSelector:@selector(showcity:)]) {
        [_delegete showcity:self.city];
        NSLog(@"11111111124444444444444444444444444%@",self.city);
    }
    
    
    return _toolBar;
}

- (void)click{
    UITextField *adTextField = (UITextField *)[self.view viewWithTag:19];
    NSString *addStr =adTextField.text ;
    if (adTextField.isFirstResponder) {
        [adTextField resignFirstResponder];
        adTextField.text = [NSString stringWithFormat:@"%@ %@ %@",self.addressView.province,self.addressView.city,self.addressView.area];
        self.province=self.addressView.province;
        self.ccity=self.addressView.city;
        self.area=self.addressView.area;
        NSLog(@"现在的地址是这里呀%@", addStr);
    }
}



-(void)NewtopView{

    _topView=[[UIView     alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 80/2.25*kAppScale*_titleArray.count)];
    _topView.backgroundColor=[UIColor whiteColor];
    [_mainSC addSubview:_topView];
    
    for (int i=0; i<_titleArray.count; i++) {
        CellView *cell=[[CellView alloc]initWithFrame:CGRectMake(0, 80/2.25*kAppScale*i, SCREEN_WIDTH, 80/2.25*kAppScale)];
        cell.topline.hidden=i!=0;
        cell.titleLabel.text=_titleArray[i];
        cell.titleLabel.textColor=blackTextColor;
        [_topView addSubview:cell];
 
        UITextField *textF=[[UITextField alloc]initWithFrame:CGRectMake(80*kAppScale, 0, SCREEN_WIDTH-80*kAppScale, 80/2.25*kAppScale)];
        textF.placeholder=_subtitleArray[i];
        textF.tag=10+i;
        textF.font=[UIFont systemFontOfSize:13*kAppScale];
        [cell addSubview:textF];
        
        if (i==3||i==8||i==11) {
           textF.keyboardType = UIKeyboardTypeNumberPad;
        }

        if (i==8) {
            textF.frame=CGRectMake(80*kAppScale, 0,120*kAppScale, 80/2.25*kAppScale);
            UIButton* btn=[[UIButton alloc]initWithFrame:CGRectMake(290*kAppScale, 0,85*kAppScale, 80/2.25*kAppScale)];
            btn.tag=108;
            btn.font=[UIFont systemFontOfSize:12*kAppScale];
            [btn   setTitleColor:[UIColor  blackColor] forState:UIControlStateNormal];
             [btn addTarget:self action:@selector(textClick:) forControlEvents:UIControlEventTouchUpInside];
            [btn setTitle:@"请选择单位" forState:UIControlStateNormal];
            btn.backgroundColor=graybackColor;
            [cell addSubview:btn];
        }
        
        
          if (i==1||i==2||i==7||i==9) {
     UIButton* btn=[[UIButton alloc]initWithFrame:CGRectMake(80*kAppScale, 0, 315*kAppScale, 80/2.25*kAppScale)];
        btn.tag=100+i;
//
        [btn addTarget:self action:@selector(textClick:) forControlEvents:UIControlEventTouchUpInside];
        [cell addSubview:btn];
//              if (i==9) {
//                 btn.frame=CGRectMake(10*kAppScale, 0, 60*kAppScale, 80/2.25*kAppScale);
//                   btn.backgroundColor=[UIColor  blueColor];
//              }
         
          }
        
//        if (i==9) {
//            UIButton* btn=[[UIButton alloc]initWithFrame:CGRectMake(80*kAppScale, 0, 230*kAppScale, 80/2.25*kAppScale)];
//            btn.backgroundColor=[UIColor redColor];
//            btn.tag=109;
//            [btn addTarget:self action:@selector(textClick:) forControlEvents:UIControlEventTouchUpInside];
//            [cell addSubview:btn];
//            
////            self.addressView = [[AddressView alloc] init];
////            textF.inputView = self.addressView;
////            textF.inputAccessoryView = self.toolBar;
////            textF.text=@"河南 郑州";
//        }
        
        
        if (i==12) {
            textF.userInteractionEnabled=NO;
        }
        if (i==13) {
            textF.frame=CGRectMake(0*kAppScale,0*kAppScale, SCREEN_WIDTH-0*kAppScale, 150*kAppScale);
            _textView=[[UITextView alloc]initWithFrame:textF.frame];
            _textView.backgroundColor=[UIColor whiteColor];
            _textView.placeholder=@"请填写自己的基本信息简介";
            [textF addSubview:_textView];
  
        }
        
        
        UIButton *statrBtn = [[UIButton alloc]initWithFrame:CGRectMake(80*kAppScale, 0, 120*kAppScale, 44*kAppScale)];
        UILabel*timeLa = [[UILabel alloc]initWithFrame:CGRectMake(statrBtn.right, 0, 10*kAppScale, 44*kAppScale)];
        UIButton *endBtn = [[UIButton alloc]initWithFrame:CGRectMake(timeLa.right+25*kAppScale, 0,120*kAppScale, 44*kAppScale)];
        if (i==4) {
            [statrBtn setTitle:@"请选择开始日期" forState:0];
            [cell addSubview:statrBtn];
            statrBtn.tag=1;
            statrBtn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft;
            [statrBtn setTitleColor:grayTextColor forState:0];
            statrBtn.titleLabel.font=[UIFont systemFontOfSize:13*kAppScale];
            [statrBtn addTarget:self action:@selector(selectTime:) forControlEvents:UIControlEventTouchUpInside];
            
            UILabel*timeLa = [[UILabel alloc]initWithFrame:CGRectMake(statrBtn.right, 0, 10*kAppScale, 44*kAppScale)];
            timeLa.font=[UIFont systemFontOfSize:12*kAppScale];
            timeLa.text=@"至";
            [cell addSubview:timeLa];
            
    
            [endBtn setTitle:@"请选择结束日期" forState:0];
            [cell addSubview:endBtn];
            endBtn.tag=2;
            endBtn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft;
            [endBtn setTitleColor:grayTextColor forState:0];
            endBtn.titleLabel.font=[UIFont systemFontOfSize:13*kAppScale];
            [endBtn addTarget:self action:@selector(selectTime:) forControlEvents:UIControlEventTouchUpInside];
            
        }
        if (i==5) {
            [statrBtn setTitle:@"请选择开始日期" forState:0];
            
            [cell addSubview:statrBtn];
            statrBtn.tag=5;
            statrBtn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft;
            [statrBtn setTitleColor:grayTextColor forState:0];
            statrBtn.titleLabel.font=[UIFont systemFontOfSize:13*kAppScale];
            [statrBtn addTarget:self action:@selector(selectTime:) forControlEvents:UIControlEventTouchUpInside];
            
            UILabel*timeLa = [[UILabel alloc]initWithFrame:CGRectMake(statrBtn.right, 0, 10*kAppScale, 44*kAppScale)];
            timeLa.font=[UIFont systemFontOfSize:12*kAppScale];
            timeLa.text=@"至";
            [cell addSubview:timeLa];
            
            
            [endBtn setTitle:@"请选择结束日期" forState:0];
            [cell addSubview:endBtn];
            endBtn.tag=6;
            endBtn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft;
            [endBtn setTitleColor:grayTextColor forState:0];
            endBtn.titleLabel.font=[UIFont systemFontOfSize:13*kAppScale];
            [endBtn addTarget:self action:@selector(selectTime:) forControlEvents:UIControlEventTouchUpInside];
        }
        
        if (i==6) {
        
              UIButton *statrBtn = [[UIButton alloc]initWithFrame:CGRectMake(80*kAppScale, 0, 120*kAppScale, 44*kAppScale)];
            [statrBtn setTitle:@"请选择截止日期" forState:0];
            
            [cell addSubview:statrBtn];
            statrBtn.tag=7;
            statrBtn.contentHorizontalAlignment=UIControlContentHorizontalAlignmentLeft;
            [statrBtn setTitleColor:grayTextColor forState:0];
            statrBtn.titleLabel.font=[UIFont systemFontOfSize:13*kAppScale];
            [statrBtn addTarget:self action:@selector(selectTime:) forControlEvents:UIControlEventTouchUpInside];
        }
        
    
        

        

    }
    
    UIButton *nextBtn=[[UIButton alloc]initWithFrame:CGRectMake(10*kAppScale, _topView.bottom+150*kAppScale,SCREEN_WIDTH-20*kAppScale,44*kAppScale)];
    nextBtn.backgroundColor=NavCOLOR;
    [nextBtn setTitle:@"下一步" forState:UIControlStateNormal];
    [nextBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    nextBtn.titleLabel.font=[UIFont systemFontOfSize:12*kAppScale];
    [nextBtn addTarget:self action:@selector(nextBtnEvent:) forControlEvents:UIControlEventTouchUpInside];
    [_mainSC addSubview:nextBtn];
    
    _mainSC.contentSize=CGSizeMake(SCREEN_WIDTH, nextBtn.bottom+10*kAppScale);
    
    


    
}




- (void)textClick:(UITextField*)tfBtn{
    [self .view  endEditing:YES];
    if (tfBtn.tag==101) {
        AlerttypeView* typeView=[AlerttypeView defaultTypeView];
        typeView.parentVC = self;
        typeView.delegate = self;
        [self lew_presentPopupView:typeView animation:[LewPopupViewAnimationSpring new] dismissed:^{
            NSLog(@"动画结束");
        }];
    }else if (tfBtn.tag==102){
        
        UITextField *passwordTextField = (UITextField *)[self.view viewWithTag:12];
   
        NSArray *title = @[@"男", @"女" , @"不限"];
        CWActionSheet *sheet = [[CWActionSheet alloc] initWithTitles:title clickAction:^(CWActionSheet *sheet, NSIndexPath *indexPath) {
            NSLog(@"点击了%@", title[indexPath.row]);
           passwordTextField.text = title[indexPath.row];
            _sex=indexPath.row  +1;
              NSLog(@"ndexPath.rondexPath.ro%d",_sex);
         
        }];
        [sheet show];
        
        
    }else if (tfBtn.tag==107){
        
        UITextField *passwordTextField = (UITextField *)[self.view viewWithTag:17];
        
        NSArray *title = @[@"日结", @"时结" ,@"次结",@"完工结"];
        CWActionSheet *sheet = [[CWActionSheet alloc] initWithTitles:title clickAction:^(CWActionSheet *sheet, NSIndexPath *indexPath) {
            NSLog(@"点击了%@", title[indexPath.row]);
            passwordTextField.text = title[indexPath.row];
                   _jiesuantype=indexPath.row+1;
        }];
        [sheet show];
        
    }else if (tfBtn.tag==108){
        
        UIButton *passwordTextField = (UIButton *)[self.view viewWithTag:108];
        
        NSArray *title = @[@"天", @"小时" ,@"次",@"预算"];
        CWActionSheet *sheet = [[CWActionSheet alloc] initWithTitles:title clickAction:^(CWActionSheet *sheet, NSIndexPath *indexPath) {
            NSLog(@"点击了%@", title[indexPath.row]);
//            passwordTextField.text = title[indexPath.row];
            [passwordTextField  setTitle:title[indexPath.row] forState:UIControlStateNormal];
                   _jiesuan_unit=indexPath.row+1;
        }];
        [sheet show];
        
    }else if (tfBtn.tag==109){
  UITextField *textF = (UITextField *)[self.view viewWithTag:19];
        self.addressView = [[AddressView alloc] init];
        textF.inputView = self.addressView;
        textF.inputAccessoryView = self.toolBar;
        
    
    }
    
    

}

-(FXTNavType)getNavType {
  return   FXTNavTypeOnlyTitle;
}
-(NSString *)getToday{
    
    NSDate *date = [NSDate date];
    NSDateFormatter *fo =[[NSDateFormatter alloc]init];
    [fo setDateFormat:@"yyyy-MM-dd"];
    NSString *str = [fo stringFromDate:date];
    return str;
    
}


- (void)nextBtnEvent:(UIButton*)sender{

  UITextField *titleTextField = (UITextField *)[self.view viewWithTag:10];
    NSString* strTitle=titleTextField.text;
  
    
    UITextField *numTextField = (UITextField *)[self.view viewWithTag:13];
    NSString* strnum=numTextField.text;
    
    UITextField *priceFS = (UITextField *)[self.view viewWithTag:17];
    NSString* FSprice=priceFS.text;
    
    UITextField *priceTextF = (UITextField *)[self.view viewWithTag:18];
    NSString* strprice=priceTextF.text;
    
    UITextField *teleField = (UITextField *)[self.view viewWithTag:20];
    NSString* strte=teleField.text;
    
    UITextField *xiangaddTextField = (UITextField *)[self.view viewWithTag:21];
    NSString* addTitle=xiangaddTextField.text;

    
    FXTHttpRequestModel * requestModel = [[FXTHttpRequestModel alloc] init];
    requestModel.type = FXTHttpType_POST;
    requestModel.appendUrl = @"/Task/addtask";
    NSMutableDictionary * paramDic = [NSMutableDictionary dictionary];
    [paramDic setValue:tokenn forKey:@"token"];
     [paramDic setValue:strTitle forKey:@"title"];
     [paramDic setValue:self.teyeli forKey:@"worktype_id"];
     [paramDic setValue:tokenn forKey:@"need_sex"];
     [paramDic setValue:addTitle forKey:@"tel"];
     [paramDic setValue:strnum forKey:@"num"];
     [paramDic setValue:_textView.text forKey:@"content"];
     [paramDic setValue:_startTime forKey:@"date_starttime"];
     [paramDic setValue:_endTime forKey:@"date_endtime"];
     [paramDic setValue:_startTimeT forKey:@"hour_starttime"];
     [paramDic setValue:_endTimeT forKey:@"hour_endtime"];
     [paramDic setValue:[NSString stringWithFormat:@"%d",_jiesuantype] forKey:@"jiesuan_type"];
     [paramDic setValue:FSprice forKey:@"jiesuan_price"];
     [paramDic setValue:[NSString stringWithFormat:@"%@",@"2"]  forKey:@"jiesuan_unit"];
     [paramDic setValue:strprice forKey:@"totalprice"];
     [paramDic setValue:self.province forKey:@"province"];
     [paramDic setValue:self.ccity forKey:@"city"];
     [paramDic setValue:self.area forKey:@"area"];
     [paramDic setValue:strte forKey:@"address"];
     [paramDic setValue:_jieTime forKey:@"enroll_endtime"];

    requestModel.paramDic = paramDic;
    requestModel.callback = ^(FXTHttpResponseModel * result, NSError *error){
        if (result.state ==FXTReponseCodeState_Success) {
            NSLog(@"请求的结果是11111%@",result.data);
            
            
        }else {
            [DisplayHelper displayWarningAlert:result.alertMsg];
        }
    };
    [[FXTHttpSessionManager sharedHttpSessionManager] sendHttpRequestParam:requestModel];
    
    
    
    
    
    
    
    
    
    
    
    
}

-(void)selectTime:(UIButton *)sender{
        [self .view  endEditing:YES];
//    UIButton *btn = (UIButton *)[self.view viewWithTag:1];
//    if ([sender.titleLabel.text isEqualToString:@"请选择结束日期"] && [btn.titleLabel.text isEqualToString:@"请选择开始日期"]) {
//
//        
//        return;
//    }
    
    
    _type = sender.tag;
    
    _bgCon = [[UIControl alloc]initWithFrame:self.view.bounds];
    _bgCon.backgroundColor=[UIColor colorWithRed:0 green:0 blue:0 alpha:0];
    [_bgCon addTarget:self action:@selector(luo) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:_bgCon];
    
    _bgVi = [[UIView alloc]initWithFrame:CGRectMake(0, SCREEN_HEIGHT-180*kAppScale, SCREEN_WIDTH, 180*selfscale)];
    _bgVi.backgroundColor=[UIColor whiteColor];
    [_bgCon addSubview:_bgVi];
    
    UIButton *quxiao = [[UIButton alloc]initWithFrame:CGRectMake(10*kAppScale, 10*kAppScale, 40*kAppScale, 20*kAppScale)];
    [quxiao setTitle:@"取消" forState:0];
    quxiao.tag=3;
    quxiao.titleLabel.font=[UIFont systemFontOfSize:13*kAppScale];
    [quxiao setTitleColor:redTextColor forState:0];
    [_bgVi addSubview:quxiao];
    [quxiao addTarget:self action:@selector(luo) forControlEvents:UIControlEventTouchUpInside];
    
    
    _datePicker = [[UIDatePicker alloc]initWithFrame:CGRectMake(0, quxiao.bottom, SCREEN_WIDTH, 150*selfscale)];
    [_datePicker addTarget:self action:@selector(dateChange:) forControlEvents:UIControlEventValueChanged];
    _datePicker.datePickerMode=UIDatePickerModeDate;
    [_bgVi addSubview:_datePicker];
    if (_type==2) {
        NSDateFormatter *fo = [NSDateFormatter new];
        [fo setDateFormat:@"yyyy-MM-dd"];
        NSDate *date = [fo dateFromString:_startTime];
        [_datePicker setMinimumDate:date];
    }
    if (_type==5) {
        NSDateFormatter *fo = [NSDateFormatter new];
        [fo setDateFormat:@"yyyy-MM-dd"];
        NSDate *date = [fo dateFromString:_startTimeT];
        [_datePicker setMinimumDate:date];
    }
    
    if (_type==6) {
        NSDateFormatter *fo = [NSDateFormatter new];
        [fo setDateFormat:@"yyyy-MM-dd"];
        NSDate *date = [fo dateFromString:_endTimeT];
        [_datePicker setMinimumDate:date];
    }

    if (_type==7) {
        NSDateFormatter *fo = [NSDateFormatter new];
        [fo setDateFormat:@"yyyy-MM-dd"];
        NSDate *date = [fo dateFromString:_jieTime];
        [_datePicker setMinimumDate:date];
    }
    
    
    UIButton *queding = [[UIButton alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-50*selfscale, 10*selfscale, 40*selfscale, 20*selfscale)];
    queding.tag=4;
    [queding setTitle:@"确定" forState:0];
    queding.titleLabel.font=DefaultFont(selfscale);
    [queding setTitleColor:redTextColor forState:0];
    [_bgVi addSubview:queding];
    [queding addTarget:self action:@selector(seleT) forControlEvents:UIControlEventTouchUpInside];
    
    
    [UIView animateWithDuration:.3 animations:^{
        
        _bgCon.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:.7];
        _bgVi.top=SCREEN_WIDTH;
        
    }];
    
    
}
-(void)dateChange:(UIDatePicker *)picker{
        if (_type==1) {
            _startTime = [self timeWithDate:picker.date];
        }else if (_type==2) {
            _endTime = [self timeWithDate:picker.date];
        }
    if (_type==5) {
        _startTimeT = [self timeWithDate:picker.date];
    }else  if(_type==6)   {
        _endTimeT = [self timeWithDate:picker.date];
    }else  if(_type==7)   {
        _jieTime = [self timeWithDate:picker.date];
    }
    
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row==12) {
        return 150*kAppScale;
    }else{
    return 44*kAppScale;
    }
    return 0;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
#pragma mark=======确定


-(void)seleT{
    [self luo];
    
    
    UIButton *btn = (UIButton *)[self.view viewWithTag:_type];
    
    if (_type==1) {
       
        _startTime = [self timeWithDate:_datePicker.date];
      
        [btn setTitle:_startTime forState:0];
    }else{
        _endTime = [self timeWithDate:_datePicker.date];
        [btn setTitle:_endTime forState:0];
    }
    [btn setTitleColor:blackTextColor forState:0];
    
    UIButton *btn2 = (UIButton *)[self.view viewWithTag:1];
    UIButton *btn1 = (UIButton *)[self.view viewWithTag:2];
    UIButton *que = (UIButton *)[self.view viewWithTag:800];
    
    
    if ([[NSString stringWithFormat:@"%@",btn2.titleLabel.text] isEqualToString:@"请选择开始日期"]||
        [[NSString stringWithFormat:@"%@",btn1.titleLabel.text] isEqualToString:@"请选择结束日期"]) {
        que.backgroundColor=blackLineColore;
    }else{
        que.backgroundColor=redTextColor;
    }
    
}

-(void)luo{
    
    [UIView animateWithDuration:.3 animations:^{
        
        _bgCon.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0];
        _bgVi.top=SCREEN_HEIGHT;
        
        
    } completion:^(BOOL finished) {
        
        [_bgCon removeFromSuperview];
        _bgCon=nil;
    }];
    
}


@end
